<template>
    <div class="header">
        <el-row class="el-row" type='flex' justify='space-between'>
            <el-col span="4">
                <img src="../assets/imgs/logo.png" class="logo-img"/>
            </el-col>
            <el-col span="4">
                <div class="title">飞跃图书吧</div>
            </el-col>
            <el-col span="10" class="user-info-container">
                <div class="user-info" v-if="admin === '2'">当前登录：{{ username }} (管理员)</div>
                <div class="user-info" v-else>当前登录：{{ username }} (用户)</div>
                <el-breadcrumb separator="|">
                    <el-breadcrumb-item to="/">退出登录</el-breadcrumb-item>
                    <el-breadcrumb-item :to="{ name: 'MyAccount', params: { username: username }}">我的账户</el-breadcrumb-item>
                    <el-breadcrumb-item></el-breadcrumb-item>
                </el-breadcrumb>
            </el-col>
        </el-row>
    </div>
</template>

<script>
export default {
    name:   'Top',
    data(){
        return{
            username:localStorage.getItem('username'),
            admin: localStorage.getItem('admin'),
            
        }
    },
    methods:{

    },
}
</script>

<style scoped>
.header {
    height: 80px;
    color: #fff;
    background-color: #409EFF;
    top: 0;
    width: 100%;
    position: fixed;
    left: 0;
    z-index: 10;
}

.el-row {
    height: 80px;
}

.title {
    font-size: 60px;
    text-align: center; /* 居中标题 */
    margin-right: 620px;
    font-family: '华文行楷', 'Microsoft YaHei', sans-serif;
}

.user-info-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    color: #fff;
    margin: 0 10px; /* 添加间隔 */
}
.logo-img{
    height: 80px;
    background-image:none;
}

</style>